<template>
    <div>
     <!-- 面包导航 -->
    <el-breadcrumb separator="/" style="padding-left:10px;padding-bottom:10px;font-size:12px;">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>其他管理</el-breadcrumb-item>
        <el-breadcrumb-item>公告管理</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 卡片主体 -->
    <el-card class="box-card">
        <div class="block">
            <div style="height: 400px;width:350px;  overflow: auto">
                <el-form :model="dataList">
                    <el-form-item label="公告"><el-input type="textarea" v-model="dataList.content"></el-input></el-form-item>
                    <el-form-item style="marginTop:20px">
                              <el-button type="primary" @click="handleAdd">发布</el-button>
                              <el-button @click="cancelBtn">重置</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </el-card>
</div>
</template>
<script>
    import noticeApi from "@/api/notice";
    import { Message } from "element-ui";
    export default {
        data() {
            return {
                dataList: {}
            };
        },
        created() {},
        methods: {
            handleAdd() {
                noticeApi.addNotice(this.dataList).then(res => {
                    Message.success(res.message);
                    this.dataList = {};
                });
            },
            cancelBtn() {
                this.dataList = {};
            }
        }
    };
</script>